# learngit2
class Animal:
    def __init__(self,name):
        self.name = name
    def feed(self):
        pass
    def say(self):
        pass

class Cat(Animal):
    def __init__(self,name):
        Animal.__init__(self,name)
    def feed(self):
        self.say()
    def say(self):
        print(f'喵喵，我是{self.name}。')
        
class Dog(Animal):
    def __init__(self,name):
        Animal.__init__(self,name)
    def feed(self):
        self.say()
    def say(self):
        print(f'汪汪，我是{self.name}。')
class Person:
    def __init__(self):
        pass
    def own(self,animal):
        if isinstance(animal,Animal):
            animal.feed()

cat=Cat('布丁')
dog=Dog('锤子')
p=Person()
p.own(cat)